- /* sfmststr.cpp by K.Tsuru */
- // function ID = 702 DRADIX
- /*****************************
- SFraction class
- It sets a value by string.
- *****************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- void SFraction::SetString(const char *s){
- char* buff = new char[strlen(s)+1];
- int slash;
- char* pt = buff;
-
- while( (*s != '/') && *s ) *(pt++) = *(s++); //copy the numerator
- slash = (*s == '/') ? 1 : 0;
- *pt = '\0';
- //It substitutes to SLong by string.
- num = buff;
- if(slash == 0){ //There is no '/'.
- den = 1.0; reduceDone = true;
- } else {
- s++; den = s;
- reduceDone = false;
- DenCheck();
- #if REDUCE_SIZE != 0
- reduce(false);
- #else
- reduce();
- #endif
- }
- delete[] buff;
- }
sfmststr.cpp : last modifiled at 2017/10/23 11:00:11(722 bytes)
created at 2015/12/22 16:07:29
The creation time of this html file is 2017/10/23 11:26:54 (Mon Oct 23 11:26:54 2017).